algalcommand.io
Class FileHelper

java.lang.Object
  extended by algalcommand.io.FileHelper

public abstract class FileHelper
extends java.lang.Object

A Utility class for handling common File IO operations.

Copyright Owner: Michigan State University, license number TEC2011-002101Prov


Constructor Summary
FileHelper()
           
 
Method Summary
static java.io.File makeLocalFile(java.lang.String localfolder, java.lang.String filename, boolean makedir)
          Makes a local folder and references a file in that folder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileHelper

public FileHelper()
Method Detail

makeLocalFile

public static java.io.File makeLocalFile(java.lang.String localfolder,
                                         java.lang.String filename,
                                         boolean makedir)
Makes a local folder and references a file in that folder. Filepaths will be local in the sense that it will be as if the working directory is the same as the executing jar file.

Parameters:
localfolder - Name of the local folder that the file will be in. Use "." for 'no folder'.
filename - The name of the file in that folder that you want to reference.
makedir - Whether or not to create a folder if the folder does not already exists. This chould be true when you want to save to the file, and false when we are only interested in testing whether or not the file exists.
Returns:
A File object referencing the specified local file.